<?php
/**
 * 菜单相关接口请求参数验证器
 * Created by PhpStorm.
 * User: LRChang
 * Date: 2018/6/14
 * Time: 09:51
 * Mail: hjklrchang@qq.com
 */

namespace app\open\validate;

use app\base\validate\BaseValidate;

class MenuValidate extends BaseValidate
{
    protected $rule = [
        'id' => 'require|isPositiveInt',
        'name' => 'require|max:32',
        'pid' => 'require|integer',
        'user_id' => 'require|integer',
        'role_id' => 'require|integer',
    ];

    protected $message = [

    ];

    protected $scene = [
        'add' => [
            'name',
            'pid',
        ],
        'edit' => [
            'id',
            'name',
            'pid',
        ],
        'user' => ['user_id'],
        'role' => ['role_id'],
    ];
}